<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
	<title>Get snapshot repository API | ElasticSearch 7.7 权威指南中文版</title>
	<meta name="keywords" content="ElasticSearch 权威指南中文版, elasticsearch 7, es7, 实时数据分析，实时数据检索" />
    <meta name="description" content="ElasticSearch 权威指南中文版, elasticsearch 7, es7, 实时数据分析，实时数据检索" />
    <!-- Give IE8 a fighting chance -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
    <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
	<link rel="stylesheet" type="text/css" href="../static/styles.css" />
	<script>
	var _link = 'get-snapshot-repo-api.html';
    </script>
</head>
<body>
<div class="main-container">
    <section id="content">
        <div class="content-wrapper">
            <section id="guide" lang="zh_cn">
                <div class="container">
                    <div class="row">
                        <div class="col-xs-12 col-sm-8 col-md-8 guide-section">
                            <div style="color:gray; word-break: break-all; font-size:12px;">原英文版地址: <a href="https://www.elastic.co/guide/en/elasticsearch/reference/7.7/get-snapshot-repo-api.html" rel="nofollow" target="_blank">https://www.elastic.co/guide/en/elasticsearch/reference/7.7/get-snapshot-repo-api.html</a>, 原文档版权归 www.elastic.co 所有<br/>本地英文版地址: <a href="../en/get-snapshot-repo-api.html" rel="nofollow" target="_blank">../en/get-snapshot-repo-api.html</a></div>
                        <!-- start body -->
                  <div class="page_header">
<strong>重要</strong>: 此版本不会发布额外的bug修复或文档更新。最新信息请参考 <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/index.html" rel="nofollow">当前版本文档</a>。
</div>
<div id="content">
<div class="breadcrumbs">
<span class="breadcrumb-link"><a href="index.html">Elasticsearch Guide [7.7]</a></span>
»
<span class="breadcrumb-link"><a href="rest-apis.html">REST APIs</a></span>
»
<span class="breadcrumb-link"><a href="snapshot-restore-apis.html">Snapshot and restore APIs</a></span>
»
<span class="breadcrumb-node">Get snapshot repository API</span>
</div>
<div class="navheader">
<span class="prev">
<a href="delete-snapshot-repo-api.html">« Delete snapshot repository API</a>
</span>
<span class="next">
<a href="put-snapshot-repo-api.html">Put snapshot repository API »</a>
</span>
</div>
<div class="section">
<div class="titlepage"><div><div>
<h2 class="title">
<a id="get-snapshot-repo-api"></a>Get snapshot repository API<a class="edit_me edit_me_private" rel="nofollow" title="Editing on GitHub is available to Elastic" href="https://github.com/elastic/elasticsearch/edit/7.7/docs/reference/snapshot-restore/apis/get-repo-api.asciidoc">edit</a>
</h2>
</div></div></div>

<p>Gets information about one or more registered
<a class="xref" href="snapshots-register-repository.html" title="Register a snapshot repository">snapshot repositories</a>.</p>
<div class="pre_wrapper lang-console">
<pre class="programlisting prettyprint lang-console">GET /_snapshot/my_repository</pre>
</div>
<div class="console_widget" data-snippet="snippets/2138.console"></div>
<div class="section">
<div class="titlepage"><div><div>
<h3 class="title">
<a id="get-snapshot-repo-api-request"></a>Request<a class="edit_me edit_me_private" rel="nofollow" title="Editing on GitHub is available to Elastic" href="https://github.com/elastic/elasticsearch/edit/7.7/docs/reference/snapshot-restore/apis/get-repo-api.asciidoc">edit</a>
</h3>
</div></div></div>
<p><code class="literal">GET /_snapshot/&lt;repository&gt;</code></p>
<p><code class="literal">GET /_snapshot</code></p>
</div>

<div class="section">
<div class="titlepage"><div><div>
<h3 class="title">
<a id="get-snapshot-repo-api-path-params"></a>Path parameters<a class="edit_me edit_me_private" rel="nofollow" title="Editing on GitHub is available to Elastic" href="https://github.com/elastic/elasticsearch/edit/7.7/docs/reference/snapshot-restore/apis/get-repo-api.asciidoc">edit</a>
</h3>
</div></div></div>
<div class="variablelist">
<dl class="variablelist">
<dt>
<span class="term">
<code class="literal">&lt;repository&gt;</code>
</span>
</dt>
<dd>
<p>
(Required, string)
Comma-separated list of snapshot repository names used to limit the request.
Wildcard (<code class="literal">*</code>) expressions are supported.
</p>
<p>To get information about all snapshot repositories registered in the
cluster, omit this parameter or use <code class="literal">*</code> or <code class="literal">_all</code>.</p>
</dd>
</dl>
</div>
</div>

<div class="section">
<div class="titlepage"><div><div>
<h3 class="title">
<a id="get-snapshot-repo-api-query-params"></a>Query parameters<a class="edit_me edit_me_private" rel="nofollow" title="Editing on GitHub is available to Elastic" href="https://github.com/elastic/elasticsearch/edit/7.7/docs/reference/snapshot-restore/apis/get-repo-api.asciidoc">edit</a>
</h3>
</div></div></div>
<div class="variablelist">
<dl class="variablelist">
<dt>
<span class="term">
<code class="literal">local</code>
</span>
</dt>
<dd>
(Optional, boolean) If <code class="literal">true</code>, the request gets information from the local node
only. If <code class="literal">false</code>, the request gets information from the master node. Defaults to
<code class="literal">false</code>.
</dd>
<dt>
<span class="term">
<code class="literal">master_timeout</code>
</span>
</dt>
<dd>
(Optional, <a class="xref" href="common-options.html#time-units" title="Time units">time units</a>) Specifies the period of time to wait for
a connection to the master node. If no response is received before the timeout
expires, the request fails and returns an error. Defaults to <code class="literal">30s</code>.
</dd>
</dl>
</div>
</div>

<div class="section child_attributes">
<div class="titlepage"><div><div>
<h3 class="title">
<a id="get-snapshot-repo-api-response-body"></a>Response body<a class="edit_me edit_me_private" rel="nofollow" title="Editing on GitHub is available to Elastic" href="https://github.com/elastic/elasticsearch/edit/7.7/docs/reference/snapshot-restore/apis/get-repo-api.asciidoc">edit</a>
</h3>
</div></div></div>
<div class="variablelist">
<dl class="variablelist">
<dt>
<span class="term">
<code class="literal">&lt;repository&gt;</code>
</span>
</dt>
<dd>
<p>
(object)
Contains information about the snapshot repository. Key is the name of the
snapshot repository.
</p>
<details open>
<summary class="title">Properties of <code class="literal">&lt;repository&gt;</code></summary>
<div class="content">
<div class="variablelist">
<dl class="variablelist">
<dt>
<span class="term">
<code class="literal">type</code>
</span>
</dt>
<dd>
<p>(string)
Repository type.</p>
<details open>
<summary class="title">Values for <code class="literal">type</code></summary>
<div class="content">
<div class="variablelist">
<dl class="variablelist">
<dt>
<span class="term">
<code class="literal">fs</code>
</span>
</dt>
<dd>
Shared file system repository. See <a class="xref" href="snapshots-register-repository.html#snapshots-filesystem-repository" title="Shared file system repository">Shared file system repository</a>.
</dd>
<dt>
<span class="term">
<span class="xpack"><code class="literal">source</code></span><a class="xpack_tag" href="https://www.elastic.co/subscriptions"></a>
</span>
</dt>
<dd>
Source-only repository. See <a class="xref" href="snapshots-register-repository.html#snapshots-source-only-repository" title="Source only repository">Source only repository</a>.
</dd>
<dt>
<span class="term">
<code class="literal">url</code>
</span>
</dt>
<dd>
URL repository. See <a class="xref" href="snapshots-register-repository.html#snapshots-read-only-repository" title="Read-only URL repository">Read-only URL repository</a>.
</dd>
</dl>
</div>
</div>
</details>
<p>More repository types are available through these official plugins:</p>
<div class="ulist itemizedlist">
<ul class="itemizedlist">
<li class="listitem">
<a href="https://www.elastic.co/guide/en/elasticsearch/plugins/7.7/repository-s3.html" class="ulink" target="_top">repository-s3</a> for S3 repository support
</li>
<li class="listitem">
<a href="https://www.elastic.co/guide/en/elasticsearch/plugins/7.7/repository-hdfs.html" class="ulink" target="_top">repository-hdfs</a> for HDFS repository support in
Hadoop environments
</li>
<li class="listitem">
<a href="https://www.elastic.co/guide/en/elasticsearch/plugins/7.7/repository-azure.html" class="ulink" target="_top">repository-azure</a> for Azure storage
repositories
</li>
<li class="listitem">
<a href="https://www.elastic.co/guide/en/elasticsearch/plugins/7.7/repository-gcs.html" class="ulink" target="_top">repository-gcs</a> for Google Cloud Storage
repositories
</li>
</ul>
</div>
</dd>
<dt>
<span class="term">
<code class="literal">settings</code>
</span>
</dt>
<dd>
<p>
(object)
Contains settings for the repository. Valid properties for the <code class="literal">settings</code> object
depend on the repository type, set using the
<a class="xref" href="put-snapshot-repo-api.html#put-snapshot-repo-api-request-type"><code class="literal">type</code></a> parameter.
</p>
<p>For properties, see the <a class="xref" href="put-snapshot-repo-api.html" title="Put snapshot repository API">put snapshot repository API</a>'s
<a class="xref" href="put-snapshot-repo-api.html#put-snapshot-repo-api-settings-param"><code class="literal">settings</code> parameter</a>.</p>
</dd>
</dl>
</div>
</div>
</details>
</dd>
</dl>
</div>
</div>

<div class="section">
<div class="titlepage"><div><div>
<h3 class="title">
<a id="get-snapshot-repo-api-example"></a>Examples<a class="edit_me edit_me_private" rel="nofollow" title="Editing on GitHub is available to Elastic" href="https://github.com/elastic/elasticsearch/edit/7.7/docs/reference/snapshot-restore/apis/get-repo-api.asciidoc">edit</a>
</h3>
</div></div></div>
<div class="pre_wrapper lang-console">
<pre class="programlisting prettyprint lang-console">GET /_snapshot/my_repository</pre>
</div>
<div class="console_widget" data-snippet="snippets/2139.console"></div>
<p>The API returns the following response:</p>
<div class="pre_wrapper lang-console-result">
<pre class="programlisting prettyprint lang-console-result">{
  "my_repository" : {
    "type" : "fs",
    "settings" : {
      "location" : "my_backup_location"
    }
  }
}</pre>
</div>
</div>

</div>
<div class="navfooter">
<span class="prev">
<a href="delete-snapshot-repo-api.html">« Delete snapshot repository API</a>
</span>
<span class="next">
<a href="put-snapshot-repo-api.html">Put snapshot repository API »</a>
</span>
</div>
</div>

                  <!-- end body -->
                        </div>
                        <div class="col-xs-12 col-sm-4 col-md-4" id="right_col">
                        
                        </div>
                    </div>
                </div>
            </section>
        </div>
    </section>
</div>
<script src="../static/cn.js"></script>
</body>
</html>